<?php 
if (0 != $topic['orders']) { 
	if ($auth['id'] != $topic['user_id']) { 
		//设置了开始时间
		if (1 == $topic['start_t'] && time() < $topic['start_t_s']) { 
			if ($has_order) { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" href="javascript:do_topic_order(<?php echo $topic_id ?>, 1)"> 取消订单 </a>
<?php 
			} else { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" > 正在加载... </a>
<?php 
			}
			//设置了结束时间
		} else if (2 == $topic['start_t']) { 
			if ($has_order) { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" href="javascript:do_topic_order(<?php echo $topic_id ?>, 2)"> 取消订单 </a>
<?php 
			} else { 
				if (time() < $topic['start_t_s']) { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" href="javascript:do_topic_order(<?php echo $topic_id ?>, 2)"> <span class="glyphicon glyphicon-th-list"></span> 下订单 </a>
<?php 
				} else if (time() > $topic['start_t_s']) { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" > 已结束 </a>
<?php 
				} 
			} 
			//未设置时间
		} else { 
			if ($has_order) { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" href="javascript:do_topic_order(<?php echo $topic_id ?>)"> 取消订单 </a>
<?php 
			} else { 
?>
<a id="do_topic_<?php echo $topic_id ?>_order" class="btn btn-success main-up order-c-s" href="javascript:do_topic_order(<?php echo $topic_id ?>)"> <span class="glyphicon glyphicon-th-list"></span> 下订单 </a>
<?php 
			} 
		} 
	} else { 
?>
<a target="_blank" class="btn btn-success main-up order-c-s" href="?c=forum&a=topic_my_order&topic_id=<?php echo $topic_id ?>"> 查看订单 <?php if ($topic['order_c'] > 0) { ?><b class="label label-success"><?php echo $topic['order_c'] ?></b><?php } ?></a>
<?php
	}
?>
<a class="btn btn-success order-c-s">
	<?php if (0 == $topic['out_s']) { ?>
	<span id="order_c_s"><?php echo $topic['order_c_s'] ?></span><?php if (1 == $topic['order_l']) echo '/'.$topic['order_l_n'] ?>
	<?php } else echo '_' ?>
</a>
<?php 
} 
?>
<a class="btn btn-warning main-up" href="javascript:do_topic_up()"><span class="glyphicon glyphicon-heart"></span> 喜欢</a>
<a class="btn btn-warning main-up-num" href="javascript:do_topic_up()"> <span id="topic_up_c"><?php echo $topic['up_c'] ?></span> </a>
